<template>
  <view class="container">
  
    <u-image src="/static/applyforactiviation.png" width="339rpx"  mode="widthFix"   />
    <view class="title">{{title}}</view>
    <view class="desc">
      {{desc}}
    </view>
    <black v-if="status == 0">
     <view class="btn-box-item btn-box-item-blue">
        <view class="btn-box-item-title">前往认证</view>
      </view>
    </black>
    <view class="btn-box"  style="justify-content: center !important;" v-if="status == 1">
      <view class="btn-box-item" @click="goToBindHouse">
        <view class="btn-box-item-title">查看绑定记录</view>
      </view>
      <view class="btn-box-item btn-box-item-blue" @click="goToHome">
        <view class="btn-box-item-title">返回首页</view>
      </view>
       <!-- <button class="primary-btn">查看绑定记录</button>
    <button class="primary-btn">订阅消息</button> -->
    </view>
  </view>
</template>

<script>
//status 0 为认证 1 绑定房屋成功
export default {
  name: 'ApplyForActivation',
  data(){
    return {
      status:1,
      title:"",
      desc:"",
      jumstatus:""
    }
  },
  onLoad(params){
   this.init(params)
  },

  methods: {
    init(params){
     if(params.jumstatus){
      this.jumstatus=params.jumstatus
     }
      this.status = params.status
     
      if(this.status == 0){
        this.title = '您已完成万科溪望小区的服务开通！'
        this.desc = '当前您可以使用问卷调查、房屋及业主管理等基础功能。若您需要使用投票、小区公告、小区财务等高级功能，请先完成小区组织状态认证。'
      }else{
        console.log("222")
        // setTimeout(()=>{
        //  uni.setNavigationBarTitle({
        //   title:"提交成功"
        //  })
        // },100)
        this.title = '提交成功'
        this.desc = '工作小组会对您提交的信息进行审核，您的房屋会在信息审核通过后正式生效。您可以订阅审核结果和消息通知。'
      }
    },
    goToHome(){
      uni.switchTab({
        url: '/pages/home/index'
      })
    },
    goToBindHouse(){
      if(this.jumstatus=="jumpto"){
        uni.redirectTo({
          url: '/pages/myhouse/myhouse'
        })
      }else{
        uni.navigateBack()
      }
      // uni.redirectTo({
      //   url: '/pages/myhouse/myhouse?delta=2'
      // })
    }
    // 可在此处添加按钮点击事件
  }
}
</script>

<style lang="scss" >
page{
    background: $uni-bg-color-grey;
}
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0rpx 54rpx;
 
  min-height: 100vh;
}
.top-img {
  width: 339rpx;
  margin-top: 89rpx;
  margin-bottom: 40rpx;
}
.title {
  font-size: 34rpx;
  font-weight: 500;
  color: #333;
  margin-bottom: 30rpx;
  text-align: center;
}
.desc {
  font-size: 28rpx;
  color: #666;
  font-weight: 400;
  margin-bottom: 60rpx;
  line-height: 1.8;
  padding: 0 20rpx;
}
.primary-btn {
  width: 100%;
  height: 81rpx;
  background: uni-color-primary;
  color: #fff;
  font-size: 30rpx;
  border-radius: 12rpx;
  text-align: center;
  line-height: 81rpx;

}
.btn-box{
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.btn-box-item{
  width: 325rpx;
  height: 88rpx;
  border-radius: 12rpx 12rpx 12rpx 12rpx;
  border: 1rpx solid #2E88Ff;
  font-weight: 500;
  font-size: 30rpx;
  color: #2E88FF;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20rpx;
}
.btn-box-item-blue{
  background: #2E88FF !important;
  color: #fff !important;
}
</style>